//
// Created by admin on 2020/7/17.
//

#ifndef DATASTRUCTURE_DEMO_H
#define DATASTRUCTURE_DEMO_H
#define MAXLEN 255
#define TRUE 1
#define FALSE 0
#define Greater 1
#define Equal 0
#define Less -1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef int Status;
typedef int Bool ;

typedef struct {
    char *ch;
    int length;
}SString;


SString StrInit();

void StrAssign(SString *S,char *chars,int length);

Status StrCompar(SString S,SString T);

int StrLength(SString S);

SString Concat(SString S,SString T);

SString SubString(SString S,int postion,int length);

SString StrCopy(SString S);

Bool StrEmpty(SString S);

void ClearString(SString *S);

int Index_BF(SString S,SString T);

void Get_Next(SString S,int next[]);

int Index_KMP(SString S,SString T,int next[]);
#endif //DATASTRUCTURE_DEMO_H
